// Definition of the ServerSocket class

#ifndef ServerSocket_class
#define ServerSocket_class

#include "Socket.h"
#include "Thread.h"
#include "Map.h"
#include "MemoryMaps.h"

class ServerSocket : private Socket,public Thread
{
 public:

	MemoryMaps * _mmapRef;

	unsigned char rawBuffer[40];

  ServerSocket (ThreadPriority pri, string _name, int port, MemoryMaps * _mmapRef );
  ServerSocket (){};
  virtual ~ServerSocket();

  virtual void run();

  const ServerSocket& operator << ( const std::string& ) const;
  const ServerSocket& operator >> ( std::string& ) const;

  void accept ( ServerSocket& );

  void send( const std::string& s ) const;
  int recv( std::string& s );

  int recv2(unsigned char * buffer);

};

#endif
